﻿/**	@file		thread_pool.h
 *	@date		(2005-10-30 10:33:16)/(2012-07-17 23:24:02)
 *-----------------------------------------------------------------------------
 *	\brief		常规线程池.
 *	@version	1.0.28.41
 *	@author		Nick Shallery	(nicknide@gmail.com)
 *	@copyright	YOU HAVE ALL LEFT WITH THIS CODE WHILE YOU KEEP COMMENT IN EVERY COPY.
 *-----------------------------------------------------------------------------
**/


#if			!defined(__LOLIX__LOLI__THREAD_POOL__K_IN_G__)
#define		__LOLIX__LOLI__THREAD_POOL__K_IN_G__
//==============================================================================
//--------------------------------------------------------------------------

#if			!defined(__LOLIX__LOLI_X_CFG__K_IN_G__)
	#include	"../lolix_cfg.h"
#endif	//	!defined(__LOLIX__LOLI_X_CFG__K_IN_G__)

#if			!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)
	#include	"../lolix_type.h"
#endif	//	!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)

#if			!defined(__LOLIX__LOLI__THREAD__NICK__K_IN_G__)
	#include	"./thread.h"
#endif	//	!defined(__LOLIX__LOLI__THREAD__NICK__K_IN_G__)

namespace lolix{namespace toy{class time_span;}}

namespace lolix{namespace loli{
class LOLIX_NO_VTABLE thread_pool
	: public itf
{
public:
	LOLIX_DEFINE_FACTORY((0x64f44f35, 0x382f4223, 0x966a12f5, 0x74ee1d65), (thread_pool** out_ptr));
	LOLIX_DECLARE_ITF(lolix::loli::thread_pool, lolix::itf, (0xa34be1e1, 0xc94c42ee, 0x8cde398f, 0x01bd693f));
	LOLIX_INTERFACE(size	, size_type		, (void)const);
	LOLIX_INTERFACE(capacity, size_type		, (void)const);
	LOLIX_INTERFACE(reserve	, LOLIX_RETNV	, (size_type));
	LOLIX_INTERFACE(insert	, LOLIX_RETNV	, (thread::query*));
	LOLIX_INTERFACE(wait	, LOLIX_RETNV	, (const toy::time_span* t_wait));
};

}}


//--------------------------------------------------------------------------
//==============================================================================
#endif	//	!defined(__LOLIX__LOLI__THREAD_POOL__K_IN_G__)
